package io.renren.modules.news.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 新闻版块
 * 新闻的实体类
 */
public class News {
    private Long newsId;  //新闻的id
    private String title;   //新闻的标题
    private int readCount;  //新闻的阅读数量
    private String[] image;  //新闻的图片数组
    private String imageList;
    private String type;   //新闻的类型
    private String sourceName;  //发表新闻的人的昵称
    private String contentUrl;  //新闻内容的路径
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date creatTime;  //新闻的创建时间
    private  int isDelete;  //新闻是否被删除 0表示已删除 1表示未删除

    private int imageCount; // 新闻中图片的数量   在增加新闻的时候 这和字段直接使用image[].length+1 就好

    private String videoPath;  //新闻中视频的路径

    private int newsType;  //0代表没有图片的新闻  1代表1张图片的新闻  3代表三张图片的新闻  4代表有视频的新闻

    private String videoPic;  //视频封面图片

    public String getVideoPic() {
        return videoPic;
    }

    public void setVideoPic(String videoPic) {
        this.videoPic = videoPic;
    }

    public int getNewsType() {
        return newsType;
    }

    public void setNewsType(int newsType) {
        this.newsType = newsType;
    }

    public String getVideoPath() {
        return videoPath;
    }

    public void setVideoPath(String videoPath) {
        this.videoPath = videoPath;
    }

    public int getImageCount() {
        return imageCount;
    }

    public void setImageCount(int imageCount) {
        this.imageCount = imageCount;
    }

    public Long getNewsId() {
        return newsId;
    }

    public void setNewsId(Long newsId) {
        this.newsId = newsId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getReadCount() {
        return readCount;
    }

    public void setReadCount(int readCount) {
        this.readCount = readCount;
    }

    public String[] getImage() {
        return image;
    }

    public void setImage(String[] image) {
        this.image = image;
    }

    public String getImageList() {
        return imageList;
    }

    public void setImageList(String imageList) {
        this.imageList = imageList;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSourceName() {
        return sourceName;
    }

    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }

    public String getContentUrl() {
        return contentUrl;
    }

    public void setContentUrl(String contentUrl) {
        this.contentUrl = contentUrl;
    }

    public Date getCreatTime() {
        return creatTime;
    }

    public void setCreatTime(Date creatTime) {
        this.creatTime = creatTime;
    }

    public int getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(int isDelete) {
        this.isDelete = isDelete;
    }

    public News(){}

    public News(Long newsId, String title, int readCount, String[] image, String imageList, String type, String sourceName, String contentUrl, Date creatTime, int isDelete, int imageCount) {
        this.newsId = newsId;
        this.title = title;
        this.readCount = readCount;
        this.image = image;
        this.imageList = imageList;
        this.type = type;
        this.sourceName = sourceName;
        this.contentUrl = contentUrl;
        this.creatTime = creatTime;
        this.isDelete = isDelete;
        this.imageCount = imageCount;
    }

    @Override
    public String toString() {
        return "News{" +
                "newsId=" + newsId +
                ", title='" + title + '\'' +
                ", readCount=" + readCount +
                ", image=" + Arrays.toString(image) +
                ", imageList='" + imageList + '\'' +
                ", type='" + type + '\'' +
                ", sourceName='" + sourceName + '\'' +
                ", contentUrl='" + contentUrl + '\'' +
                ", creatTime=" + creatTime +
                ", isDelete=" + isDelete +
                ", imageCount=" + imageCount +
                '}';
    }
}
